GtkCssProvider: Small optimization.
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 4 Aug 2010 09:36:21 +0000 (11:36 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:37:33 +0000 (15:37 +0100)
gtk/gtkcssprovider.c

index 67dc3f68cec04232353fa94831abb81b5bf09e0a..8deae7e75ce0e38eb936b8ed38077e68bb29f4d3 100644 (file)
@@ -429,10 +429,12 @@ compare_selector (GtkWidgetPath *path,
   GSList *elements = selector->elements;
   gboolean match = TRUE;
   guint64 score = 0;
+  guint len;
   guint i = 0;
 
-  while (elements && match &&
-         i < gtk_widget_path_length (path))
+  len = gtk_widget_path_length (path);
+
+  while (elements && match && i < len)
     {
       SelectorElement *elem;
       guint8 elem_score;